<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>htmlcss 阶段</title>
    <style></style>
</head>
<body>



<script>
    // 写一个函数，去除字符串中所有的空格字符
    function myTrim(str) {
        var res = str.replace(/\s*/g , "");
        console.log(res);
    }
    
    myTrim("  hello   world  ");//   helloworld
    myTrim("123  456 789");//  123456789



</script>
</body>
</html>